<?php
/*
 * Copyright 2013 by Jerrick Hoang, Ivy Xing, Sam Roberts, James Cook, 
 * Johnny Coster, Judy Yang, Jackson Moniaga, Oliver Radwan, 
 * Maxwell Palmer, Nolan McNair, Taylor Talmage, and Allen Tucker. 
 * This program is part of RMH Homebase, which is free software.  It comes with 
 * absolutely no warranty. You can redistribute and/or modify it under the terms 
 * of the GNU General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 * 
 */

/**
 * Client class for Forestdale.
 * @author Joseph Chang, Donald Barclay
 * @version 1.1, modified 3/28/2014
 */
/**
 * Represents one client (patient) of the clinic
 * The clientID is automatically generated from the client's first name
 * concatenated with the phone number, from which the dashes have been removed
 * Thus, a client named Fred, with a phone number of  212-778-7079 would end 
 * up with an id of Fred2127787079
 */
include_once(dirname(__FILE__).'/../database/dbShifts.php');
include_once(dirname(__FILE__).'/../database/dbClient.php');
include_once('Shift.php');
include_once('Client.php');

class Client {
    private $clientID; // client ID (Primary Key)
    private $first_name; // first name as a string
    private $last_name; // last name as a string
    private $SSN; //format: 012-34-5678
    private $gender; // gender – string
    private $birthday; // format: 03-12-64
    private $phone1; // main phone
    private $phone2; // alternate phone
    private $status; // active/inactive for 6 months of activity
    private $medication_taken; // notes for medications that the client is taking.
    private $admission_physical_notes;
    private $discharge_physical_notes;

    // constructor for clients
    function __construct($fn, $ln, $ssn, $g, $bd, $p1, $p2, $status, $med, $apn, $dpn)
    {
       $idPhone = str_replace('-', '', $p1);
        $this->clientID = $fn . $idPhone;  // id is concatenated from first name and phone1
        $this->first_name = $fn;
        $this->last_name = $ln;
        $this->SSN = $ssn;
        $this->gender = $g;
        $this->birthday = $bd;
        $this->phone1 = $p1;
        $this->phone2 = $p2;
        $this->status = $status;
        $this->medication_taken = $med;
        $this->admission_physical_notes = $apn;
        $this->discharge_physical_notes = $dpn;
    }

    // get functions for variables
    function get_clientID() {
        return $this->clientID;
    }
    function get_first_name() {
        return $this->first_name;
    }
    function get_last_name() {
        return $this->last_name;
    }
    function get_SSN()  {
        return $this->SSN;
    }
    function get_gender() {
        return $this->gender;
    }
    function get_birthday() {
        return $this->birthday;
    }
    function get_phone1() {
        return $this->phone1;
    }
    function get_phone2() {
        return $this->phone2;
    }
    function get_status() {
        return $this->status;
    }
    function get_medication_taken() {
        return $this->medication_taken;
    }
    function get_admission_physical_notes() {
        return $this->admission_physical_notes;
    }
    function get_discharge_physical_notes() {
        return $this->discharge_physical_notes;
    }
    /*
     * Discharge Notes
     */
    function set_clientID($cid) {
        $this->id = $cid;
    }
    function set_first_name($fn) {
        $this->first_name =$fn;
    }
    function set_last_name($ln) {
        $this->last_name = $ln;
    }
    function set_SSN($ssn)  {
        $this->SSN = $ssn;
    }
    function set_gender($gen) {
        $this->gender = $gen;
    }
    function set_birthday($bday) {
        $this->birthday = $bday;
    }
    function set_phone1($p1) {
        $this->phone1 = $p1;
    }
    function set_phone2($p2) {
        $this->phone2 = $p2;
    }
    function set_status($stat) {
        $this->status = $stat;
    }
    function set_medication_taken($meds) {
        $this->medication_taken = $meds;
    }
    function set_admission_physical_notes($admit) {
        $this->admission_physical_notes = $admitNotes;
    }
    function set_discharge_physical_notes($disNotes) {
        $this->discharge_physical_notes = $disNotes;
    }

    
    }// end of Client class
?>
